﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for Article_BU
/// </summary>
public class Article_BU
{
    ArticleDAL arDAL = new ArticleDAL();
    public int Update_Article_BU(int article_id, string article_name, string article_sumary, string article_des, string image, int category_id, int topic_id, bool status, int language_id,string author)
    {
        Article ar = new Article();
        Article_Description ar_des = new Article_Description();
        ar.article_id = article_id;
        ar_des.article_name = article_name;
        ar_des.article_sumary = article_sumary;
        ar_des.article_des = article_des;
        ar_des.author = author;
        ar.image = image;
        ar.category_id = category_id;
        ar.topic_id = topic_id;
        ar.status = status;
        ar_des.language_id = language_id;
        return arDAL.Update_Article_DAL(ar,ar_des);
    }


    public DataTable Get_Article_By_Id_Category_BU(int Id_Category) {
        Article art = new Article();
        art.category_id = Id_Category;
        return arDAL.Get_Article_By_Id_Category_DAL(art);
    }

    public DataTable Get_All_Article_BU() {
        return arDAL.Get_All_Article();
    }

    public DataTable Get_Article_By_Id_BU(int Id_Article) {
        Article art = new Article();
        art.article_id = Id_Article;
        return arDAL.Get_Article_By_Id_DAL(art);
    }

    public DataTable getArticleOrderByDate(int language_id, int top)
    {
        return arDAL.getArticleOrderByDate(language_id,top);
    }

    public DataTable getArticleByCategoryID(int language_id,int category_id,int top)
    {
        return arDAL.getArticleByCategoryID(language_id,category_id,top);
    }


    public int Delete_Article_BU(int article_id) {
        return arDAL.Delete_Article(article_id);
    }

    public DataTable getArticleByID(int language_id, int article_id)
    {
        return arDAL.getArticleByID(language_id, article_id);
    }

}